home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / lvswin.zip / WINMOUSE.HPP < prev    next >
C/C++ Source or Header  |  1991-10-17  |  3KB  |  68 lines

  1. /*
  2.  *            LVS Windows
  3.  *      The Window Class System
  4.  *
  5.  *        Copyright 1991 (c), Lake View Software
  6.  *                            4321 Harborough Rd.
  7.  *                            Columbus, OH 43220
  8.  *        All rights reserved.
  9.  */
  10. // WinMouse.hpp
  11.  
  12. #ifndef WINMOUSE_HPP
  13. #define WINMOUSE_HPP
  14.  
  15. #include "WinObj.Hpp"
  16.  
  17. /*
  18.  * Mouse Modes
  19.  */
  20.  
  21. #define M_NONE          0           /* No mouse support */
  22. #define M_SIMPLE        1           /* Simple cursor replacement Mode */
  23. #define M_FULL          2           /* Full function mouse support */
  24.  
  25. #define     DELTAX       16         /* amount of change to cause an arrow */
  26. #define     DELTAY       16         /* key when in simple mode */
  27.  
  28. #define     PIXELS        8         /* Pixels / screen coordinate */
  29.  
  30. class WinMouse {
  31.     private:
  32.         int Mouse_Mode;             /* Mouse Init flag / mode */
  33.         int Mouse_Buttons;          /* Number of mouse button */
  34.         int Mouse_Hidden;           /* Mouse hidden flag */
  35.         void scan_full ();          /* Scan full mouse support */
  36.     public:
  37.         void clear_counters ();     /* clear counters for mouse_scan */
  38.         void scan ();               /* translate clicks to keys */
  39.         WinMouse (int mode = M_SIMPLE);
  40.         ~WinMouse ();
  41.  
  42.         void close ();                  /* close the mouse */
  43.         int init (int mode = M_SIMPLE); /* Mouse init function */
  44.         int get_mode ();                /* Get current mouse mode */
  45.         void motion (int &y, int &x);   /* Return micky motion in char */
  46.         void position (int y, int x);   /* Position the mouse cursor */
  47.         int clicks (int button, int &y, int &x); /* get click count  returns 
  48.                                                     position of last click */
  49.         int releases (int button, int &y, int &x); /* get click count  returns 
  50.                                                     position of last release */
  51.         void show ();                   /* Display the mouse cursor */
  52.         void hide ();                   /* Hide the cursor */
  53.         int status (int &y, int &x);    /* mouse status */
  54.         int x ();                       /* return current x coordinate */
  55.         int y ();                       /* return y coordinate */
  56.         void limit_x (int min, int max); /* limit mouse x coordinates */
  57.         void limit_y (int min, int max); /* limit mouse y coordinates */
  58.         int protect (int sr, int sc, int er, int ec);  /* protect cursor */
  59. };
  60.  
  61. /*
  62.  * Globals
  63.  */
  64. extern WinMouse Win_mouse;
  65. int Win_mouse_mode (int mode = M_SIMPLE);
  66.  
  67. #endif   // ndef WINMOUSE_HPP
  68.